<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

    <base href="<%=basePath%>">
    <title>行业管理-服务人员查改</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <link rel="stylesheet" type="text/css"
          href="css/manage/article_select.css">
    <script src="js/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script src="js/jquery-jbox/2.3/jquery.jBox-2.3.min.js"
            type="text/javascript"></script>
    <link rel="stylesheet" type="text/css"
          href="css/jquery-jbox/2.3/Skins/Bootstrap/jbox.css">
    <style type="text/css">
        th {
            text-align: center;
        }

        .a1 {
            color: #2266A9
        }
    </style>
</head>

<body>
<div class="right-nav" style=" margin-left: -55px;">
    <form action="delete.do" method="post" id="tableForm">
        <input type="submit" id="del" style="margin-top: 15px;float: right;"
               class="imp_btn" value="删除">
        <input type="button" id="btnImport" class="imp_btn" value="导入"
               style="margin-top: 15px;float: right;">
    </form>
</div>
<div id="main" style="margin-left: 150px;">
    <div id="biao">
        <table id="rounded-corner" border="1">
            <tr class="even">
                <th style="width: 60px;">姓名</th>
                <th style="width: 60px">性别</th>
                <th style="width: 150px">身份证号</th>
                <th style="width: 150px">机构</th>
                <th style="width: 60px">单位性质</th>
                <th style="width: 150px;">资质编号</th>
                <th style="width: 150px;">会籍(铜牌)编号</th>
                <th style="width: 150px;">个人资质(证书)及职称</th>
                <th style="width: 60px">操作选项</th>
            </tr>
            <c:forEach items="${page.result }" var="waiter">
                <tr style="font-size: 12px;text-align: center;height: 25px">
                    <td><a>${waiter.name }</a></td>
                    <td>${waiter.sex }</td>
                    <td><a>${waiter.idcard }</a></td>
                    <td><a
                            style="display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:90px; ">${waiter.affiliation }</a>
                    </td>
                    <td>${waiter.type }</td>
                    <td>${waiter.qualId }</td>
                    <td>${waiter.medalId }</td>
                    <td>${waiter.persion }</td>
                    <td><a class="a1" href="see.do?id=${waiter.id }">查看</a>
                    </td>
                </tr>
            </c:forEach>
        </table>
        <div style="float: left;margin-left: 175px;margin-top: 27px;">
            <form
                    action="select.do?numPerPage=10"
                    onsubmit="return changeNum()" method="post">
                总页数：${page.pageNum }/${page.totalPage }&nbsp;&nbsp;
                总条数：${page.totalCount}&nbsp;&nbsp; <a
                    href="select.do?pageNum=1&numPerPage=10">首页</a>&nbsp;&nbsp;
                <c:if test="${page.pageNum gt 1}">
                    <a href="select.do?numPerPage=10&pageNum=${page.pageNum-1}">上一页</a>&nbsp;&nbsp;
                </c:if>
                <c:if test="${page.pageNum lt page.totalPage}">
                    <a href="select.do?numPerPage=10&pageNum=${page.pageNum+1}">下一页</a>&nbsp;&nbsp;
                </c:if>
                <a
                        href="select.do?numPerPage=10&pageNum=${page.totalPage}">末页</a>
                &nbsp;&nbsp;跳转到： <input type="text" name="pageNum"
                                        style="width:50px;" id="js_splitpage">页&nbsp;&nbsp;
                <input
                        type="submit" value="跳转">&nbsp;&nbsp;
            </form>
        </div>
    </div>
</div>

</body>
<script type="text/javascript">
  function changeNum() {
    var a = document.getElementById("js_splitpage");
    if (!/^[1-9]\d*$/.test(a.value)) {
      alert("请输入正确的页码！");
      a.value = "";
      return false;
    }
    var p = document.getElementById("js_splitpage").value;
    if (p > ${page.totalPage}) {//判断当前页是否大于最大页
      alert('请输入正确的页码！');
      a.value = "";
      return false;
    }
  }
</script>
<script>
  function importSub() {
    var i = $("#uploadFile").val();
    if (i == "") {
      $(".error").html("请选择导入文件");
      return false;
    }
    var ext = i.substr(i.lastIndexOf(".")).toLowerCase();//获得文件后缀名
    if (ext != '.xls' && ext != '.xlsx') {
      $(".error").html("仅允许导入“.xls”格式文件！");
      return false;
    }
    loading("正在导入，请稍等...");

    $(".jbox-body").css("display", "none");
    return true;
  }

  $(document)
  .ready(
      function () {
        $("#btnImport")
        .click(
            function () {
              $
              .jBox(
                  '<form id="importForm" action="javapoi.do"  method="post" enctype="multipart/form-data"'
                  + 'style="padding-left:20px;text-align:center;" class="form-search" onsubmit="return importSub();"><br/>'
                  + '<input type="hidden" name="type" value="1"/>'
                  + '<input id="uploadFile" name="file" type="file" style="width:230px"  class="required"/>　'
                  + '<label for="name" generated="true" class="error"></label><br/><br/>'
                  + '<input id="btnImportSubmit" class="btn btn-primary" type="submit" value=" 导    入   "/>'
                  + '<a href="http://pic.sdjx.net.cn/other/%E4%B8%8A%E4%BC%A0%E6%A8%A1%E6%9D%BF.xlsx">下载模板</a>'
                  + '</form>',
                  {
                    title: "导入数据",
                    buttons: {
                      "关闭": true
                    },
                    bottomText: "导入文件仅允许导入“xls”格式文件！"
                  });
            });
      });
</script>
</html>
